home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
M2
/
GDOS.MOD
< prev
next >
Wrap
Text File
|
2000-09-26
|
22KB
|
736 lines
(*$S- *)
MODULE GDOS;
FROM SYSTEM IMPORT ASSEMBLER,BYTE,WORD,ADDRESS,ADR,OFS,SEG,SEGMENT,OFFSET;
FROM Storage IMPORT ALLOCATE,DEALLOCATE;
FROM Strings IMPORT Length,Copy;
FROM System IMPORT AX,BX,CX,DX,ES,DS,SI,DI,Trap,XTrap,Move,SetVector,GetVector,
TermProcedure,Terminate,InstallRTErrorHandler,
UninstallRTErrorHandler;
FROM InOut IMPORT WriteString,WriteCard,WriteHex,WriteLn;
FROM VGA IMPORT CopyVideo2Buffer,CopyBuffer2Video,SetRGB,DrawBorder,PutText,
CheckVGA,ClearVideo,DrawX;
FROM Mouse IMPORT MouseOn,MouseOff,CheckMouse,WaitForKey,GetMouseData,
WaitForClick;
FROM GEM IMPORT InstallGDOSVector,RemoveGDOSVector,GDOS,GDOSPtr,gdos;
FROM DOS IMPORT OpenTemporaryFile,CloseTemporaryFile,ReadFile,
WriteFile,SeekFile,offsetBeginning,FileHandlePtr;
FROM GEM IMPORT Window,WindowPtr,WindowFlags,WindowFlagSet,SystemMessagePtr,
MessageClasses,MessageClassSet,MouseButtons,MouseButtonSet,
STRING,GadgetTypes,GadgetTypeSet,Gadget,GadgetPtr,Menu,MenuPtr;
VAR bool : BOOLEAN;
a,b : CARDINAL;
c,d : LONGCARD;
titel : ARRAY [0..30] OF ARRAY [0..79] OF CHAR;
msg : SystemMessagePtr;
w1,w2,w3,w4,w5 : WindowPtr;
m1 : MenuPtr;
PROCEDURE Crash(text : ARRAY OF CHAR);
VAR l,x : CARDINAL;
tex : ARRAY [0..79] OF CHAR;
BEGIN
tex := "NICHT BEHEBBARER FEHLER BEI DER PROGRAMMAUSFHRUNG";
IF (gdos = NIL) THEN
WriteString(tex);
WriteLn;
WriteString(text);
WriteLn;
WriteLn;
ELSE
ClearVideo(40,128,560,112);
DrawBorder(15,1,40,128,560,112);
PutText(14,(80-Length(tex)) DIV 2,10,ADR(tex));
Copy(text,0,Length(text),tex);
PutText(14,(80-Length(tex)) DIV 2,12,ADR(tex));
WaitForKey;
END (* IF *);
Terminate(0);
END Crash;
(* ----------- Hauptprogramm ------------------ *)
PROCEDURE RTErrorHandler(fehler : CARDINAL; adresse : ADDRESS);
VAR w : WindowPtr;
BEGIN
IF (gdos # NIL) THEN RemoveGDOSVector(); END;
WriteString("NICHT BEHEBBARER FEHLER BEI DER PROGRAMMAUSFHRUNG!");
WriteLn;
WriteString("Abbruch durch Modula-2 RunTime-Fehler #");
WriteCard(fehler,1);
WriteLn;
WriteLn;
END RTErrorHandler;
PROCEDURE Terminator;
BEGIN
IF (gdos # NIL) THEN RemoveGDOSVector(); END;
WriteString("bye!");
WriteLn;
END Terminator;
PROCEDURE AddBoolGadget(win : WindowPtr;
x,y,w,h : CARDINAL;
text : STRING;
id : CARDINAL);
VAR gad : GadgetPtr;
BEGIN
ALLOCATE(gad,SIZE(Gadget));
IF (gad=NIL) THEN
Crash("Nicht genug Speicher fr Bildschirmelemente!");
END (* IF *);
gad^.nextGadget := win^.firstGadget;
gad^.leftEdge := x;
gad^.topEdge := y;
gad^.width := w;
gad^.height := h;
gad^.x1 := x*8;
gad^.y1 := y*16;
gad^.w := w*8;
gad^.h := h*16;
gad^.x2 := gad^.x1+gad^.w;
gad^.y2 := gad^.y1+gad^.h;
gad^.type := GadgetTypeSet{boolean};
gad^.text := text;
gad^.id := id;
win^.firstGadget := gad;
PutText(3,win^.leftEdge+gad^.leftEdge+1,win^.topEdge+gad^.topEdge,text);
DrawBorder(15,1,win^.x1+gad^.x1,win^.y1+gad^.y1,gad^.w,gad^.h);
END AddBoolGadget;
PROCEDURE AddMinGadget(win : WindowPtr;
x1,y1,w,h : CARDINAL;
type : GadgetTypeSet;
id : CARDINAL) : GadgetPtr;
VAR gad : GadgetPtr;
BEGIN
ALLOCATE(gad,SIZE(Gadget));
IF (gad=NIL) THEN
Crash("Nicht genug Speicher fr Bildschirmelemente!");
END (* IF *);
gad^.nextGadget := win^.firstGadget;
gad^.x1 := x1;
gad^.y1 := y1;
gad^.w := w;
gad^.h := h;
gad^.x2 := x1+w;
gad^.y2 := y1+h;
gad^.type := type;
gad^.text := NIL;
gad^.id := id;
win^.firstGadget := gad;
RETURN(gad);
END AddMinGadget;
PROCEDURE AddMenu(win : WindowPtr;
x,w : CARDINAL;
text : STRING;
enabled : BOOLEAN) : MenuPtr;
VAR gad : GadgetPtr;
menu : MenuPtr;
l : CARDINAL;
BEGIN
ALLOCATE(menu,SIZE(Menu));
IF (menu=NIL) THEN
Crash("Nicht genug Speicher fr Men!");
END (* IF *);
l := Length(text^);
menu^.nextMenu := win^.firstMenu;
menu^.text := text;
menu^.enabled := enabled;
menu^.mx1 := x*8;
menu^.mx2 := (x+l)*8;
menu^.leftEdge := x;
menu^.width := w;
menu^.x1 := x*8;
menu^.x2 := (x+w)*8;
menu^.itemCount := 0;
win^.firstMenu := menu;
PutText(5,x,1,text);
RETURN(menu);
END AddMenu;
PROCEDURE AddItem(menu : MenuPtr;
text : STRING;
checkit : BOOLEAN;
checked : BOOLEAN;
enabled : BOOLEAN);
BEGIN
IF (menu^.itemCount=24) THEN
Crash("AddItem(): Mehr als 25 Items in einem Men!");
END (* IF *);
menu^.items[menu^.itemCount].text := text;
menu^.items[menu^.itemCount].checked := checked;
menu^.items[menu^.itemCount].checkit := checkit;
menu^.items[menu^.itemCount].enabled := enabled;
menu^.itemCount := menu^.itemCount + 1;
END AddItem;
PROCEDURE SetTitleColor(win : WindowPtr; bool : BOOLEAN);
VAR farbe : CARDINAL;
BEGIN
MouseOff();
IF (win^.lock=TRUE) THEN bool := FALSE; END;
IF (bool=TRUE) THEN farbe := 9; ELSE farbe := 10; END;
IF (win # NIL) THEN
IF NOT (borderless IN win^.flags) THEN
IF NOT (windowClose IN win^.flags) THEN
PutText(farbe,win^.leftEdge+1,win^.topEdge,win^.title);
ELSE
PutText(farbe,win^.leftEdge+3,win^.topEdge,win^.title);
END (* IF *);
DrawBorder(15,1,win^.x1,win^.y1,win^.w-1,16);
END (* IF *);
END (* IF *);
MouseOn();
END SetTitleColor;
PROCEDURE RestoreWindow(win : WindowPtr);
VAR long : LONGCARD;
size,i,y,h,h2 : CARDINAL;
BEGIN
MouseOff();
long := LONG(win^.w)*LONG(win^.h) DIV 2L;
IF (memSwap IN win^.flags) AND (long<=65000L) THEN
IF (win^.swapMem # NIL) THEN
CopyBuffer2Video(win^.swapMem,win^.x1,win^.y1,win^.w,win^.h);
END (* IF *);
ELSE
IF (win^.swapFile # NIL) THEN
IF (long>65000L) THEN
y := win^.y1;
h := win^.h;
WHILE (h>0) DO
h2 := h;
IF h2>100 THEN h2 := 50; END;
h := h - h2;
size := win^.w * (h2 DIV 2);
i := ReadFile(win^.swapFile,gdos^.graphics64,size);
CopyBuffer2Video(gdos^.graphics64,win^.x1,y,win^.w,h2);
y := y + h2;
END (* WHILE *);
ELSE
size := SHORT(long);
i := ReadFile(win^.swapFile,gdos^.graphics64,size);
CopyBuffer2Video(gdos^.graphics64,win^.x1,win^.y1,win^.w,win^.h) ;
END (* IF *);
END (* IF *);
SeekFile(win^.swapFile,0L,offsetBeginning);
END (* IF *);
MouseOn();
END RestoreWindow;
PROCEDURE BackupWindow(win : WindowPtr);
VAR long : LONGCARD;
size,i,y,h,h2 : CARDINAL;
BEGIN
MouseOff();
long := LONG(win^.w)*LONG(win^.h) DIV 2L;
IF (memSwap IN win^.flags) AND (long<=65000L) THEN
size := SHORT(long);
IF (win^.swapMem=NIL) THEN
ALLOCATE(win^.swapMem,size);
IF (win^.swapMem=NIL) THEN
Crash("Nicht genug Speicher zur Grafikauslagerung!");
END (* IF *);
END (* IF *);
win^.swapSize := size;
CopyVideo2Buffer(win^.swapMem,win^.x1,win^.y1,win^.w,win^.h);
ELSE
IF (win^.swapFile=NIL) THEN win^.swapFile := OpenTemporaryFile(); END;
IF (win^.swapFile # NIL) THEN
IF (long>65000L) THEN
y := win^.y1;
h := win^.h;
WHILE (h>0) DO
h2 := h;
IF h2>100 THEN h2 := 50; END;
h := h - h2;
size := win^.w * (h2 DIV 2);
CopyVideo2Buffer(gdos^.graphics64,win^.x1,y,win^.w,h2);
i := WriteFile(win^.swapFile,gdos^.graphics64,size);
y := y + h2;
END (* WHILE *);
ELSE
size := SHORT(long);
CopyVideo2Buffer(gdos^.graphics64,win^.x1,win^.y1,win^.w,win^.h);
i := WriteFile(win^.swapFile,gdos^.graphics64,size);
END (* IF *);
SeekFile(win^.swapFile,0L,offsetBeginning);
ELSE
Crash("Erstellung von temporren Dateien nicht mglich!");
END (* IF *);
END (* IF *);
MouseOn();
END BackupWindow;
PROCEDURE ClearWindow(win : WindowPtr);
VAR long : LONGCARD;
z,h1,h2 : CARDINAL;
BEGIN
long := LONG(win^.w)*LONG(win^.h) DIV 2L;
MouseOff();
IF (long>65000L) THEN
z := win^.y1;
h1 := win^.h;
WHILE (h1>0) DO
h2 := h1;
IF h2>100 THEN h2 := 50; END;
h1 := h1 - h2;
ClearVideo(win^.x1,z,win^.w,h2);
z := z + h2;
END (* WHILE *);
ELSE
ClearVideo(win^.x1,win^.y1,win^.w,win^.h);
END (* IF *);
MouseOn();
END ClearWindow;
PROCEDURE RestoreVideo(win : WindowPtr);
VAR w2 : WindowPtr;
BEGIN
w2 := win^.nextWindow;
IF (w2 # NIL) THEN RestoreVideo(w2); END;
RestoreWindow(win);
END RestoreVideo;
PROCEDURE InactivateWindow(win : WindowPtr);
VAR long : LONGCARD;
size,i,y,h,h2 : CARDINAL;
BEGIN
MouseOff();
ClearVideo(8,16,624,16);
SetTitleColor(win,FALSE);
BackupWindow(win);
MouseOn();
END InactivateWindow;
PROCEDURE ActivateWindow(win : WindowPtr);
VAR w2 : WindowPtr;
menu : MenuPtr;
BEGIN
MouseOff();
IF NOT (win=gdos^.firstWindow) THEN
InactivateWindow(gdos^.firstWindow);
RestoreWindow(win);
SetTitleColor(win,TRUE);
w2 := gdos^.firstWindow;
WHILE (w2^.nextWindow<>win) DO
w2 := w2^.nextWindow;
END (* WHILE *);
w2^.nextWindow := win^.nextWindow;
win^.nextWindow := gdos^.firstWindow;
gdos^.firstWindow := win;
menu := win^.firstMenu;
WHILE (menu # NIL) DO
PutText(5,menu^.leftEdge,1,menu^.text);
menu := menu^.nextMenu;
END (* WHILE *);
END (* IF *);
MouseOn();
END ActivateWindow;
PROCEDURE OpenWindow(title : STRING;
x,y,w,h : CARDINAL;
flags : WindowFlagSet) : WindowPtr;
VAR win : WindowPtr;
gad : GadgetPtr;
BEGIN
ALLOCATE(win,SIZE(Window));
IF (win=NIL) THEN
Crash("OpenWindow(): Nicht genug Speicher fr neues Fenster!");
END (* IF *);
win^.nextWindow := gdos^.firstWindow;
win^.leftEdge := x;
win^.topEdge := y;
win^.width := w;
win^.height := h;
win^.x1 := x*8;
win^.y1 := y*16;
win^.w := w*8;
win^.h := h*16;
win^.x2 := win^.x1+win^.w;
win^.y2 := win^.y1+win^.h;
win^.firstGadget := NIL;
win^.firstMenu := NIL;
win^.title := title;
win^.flags := flags;
win^.swapFile := NIL;
win^.swapMem := NIL;
win^.swapSize := 0;
win^.lock := FALSE;
IF (gdos^.firstWindow # NIL) THEN InactivateWindow(gdos^.firstWindow); END;
gdos^.firstWindow := win;
MouseOff();
ClearWindow(win);
IF (windowClose IN flags) THEN
DrawBorder(15,1,win^.x1,win^.y1,16,16);
DrawBorder(15,1,win^.x1+4,win^.y1+4,8,8);
gad := AddMinGadget(win,0,0,16,16,GadgetTypeSet{systemClose},0);
END (* IF *);
IF (windowDepth IN flags) THEN
DrawBorder(15,1,win^.x2-17,win^.y1,16,16);
DrawBorder(1,15,win^.x2-12,win^.y1+4,8,8);
DrawBorder(15,1,win^.x2-14,win^.y1+2,8,8);
gad := AddMinGadget(win,win^.w-17,0,16,16,GadgetTypeSet{systemDepth},0);
END (* IF *);
SetTitleColor(win,TRUE);
DrawBorder(15,1,win^.x1,win^.y1,win^.w-1,win^.h-1);
MouseOn();
RETURN(win);
END OpenWindow;
PROCEDURE CloseWindow(win : WindowPtr);
VAR w2 : WindowPtr;
BEGIN
w2 := gdos^.firstWindow;
IF NOT (w2=win) THEN
BackupWindow(w2);
WHILE NOT (w2^.nextWindow=win) DO
w2 := w2^.nextWindow;
END (* WHILE *);
w2^.nextWindow := win^.nextWindow;
ELSE
gdos^.firstWindow := win^.nextWindow;
END (* IF *);
IF (win^.swapFile # NIL) THEN
CloseTemporaryFile(win^.swapFile);
END (* IF *);
IF (win^.swapMem # NIL) THEN
DEALLOCATE(win^.swapMem,win^.swapSize);
END (* IF *);
ClearWindow(win);
IF (gdos^.firstWindow # NIL) THEN
RestoreVideo(gdos^.firstWindow);
SetTitleColor(gdos^.firstWindow,TRUE);
END (* IF *);
DEALLOCATE(win,SIZE(Window));
END CloseWindow;
PROCEDURE LockWindow(win : WindowPtr);
BEGIN
win^.lock := TRUE;
SetTitleColor(win,FALSE);
END LockWindow;
PROCEDURE UnlockWindow(win : WindowPtr);
BEGIN
win^.lock := FALSE;
END UnlockWindow;
PROCEDURE GetWindowPtr(x,y : CARDINAL) : WindowPtr;
VAR win : WindowPtr;
BEGIN
win := gdos^.firstWindow;
IF y<33 THEN RETURN(win); END;
WHILE (win # NIL) DO
IF (x>=win^.x1) AND (y>=win^.y1) AND (x<=win^.x2) AND (y<=win^.y2) THEN
RETURN(win);
END (* IF *);
win := win^.nextWindow;
END (* WHILE *);
RETURN(NIL);
END GetWindowPtr;
PROCEDURE OpenMenu(menu : MenuPtr; ptr : SystemMessagePtr) : BOOLEAN;
VAR w,h,i,
oy,x,y : CARDINAL;
bool : BOOLEAN;
chkmark : ARRAY [0..3] OF CHAR;
BEGIN
IF (menu^.itemCount=0) THEN RETURN(FALSE); END;
bool := FALSE;
chkmark := 373C;
MouseOff();
PutText(14,menu^.leftEdge,1,menu^.text);
w := menu^.width*8;
h := menu^.itemCount*16+16;
CopyVideo2Buffer(gdos^.graphics64,menu^.x1,24,w,h);
ClearVideo(menu^.x1,24,w,h);
DrawBorder(15,1,menu^.x1,25,w-1,h-2);
FOR i := 0 TO menu^.itemCount-1 DO
IF (menu^.items[i].text # NIL) THEN
IF (menu^.items[i].enabled=FALSE) THEN
oy := 3;
ELSE
oy := 5;
END (* IF *);
PutText(oy,menu^.leftEdge+1,i+2,menu^.items[i].text);
IF (menu^.items[i].checked=TRUE) THEN
PutText(6,(menu^.leftEdge+menu^.width-2),i+2,ADR(chkmark));
END (* IF *);
ELSE
DrawX(15,menu^.x1+1,((2+i)*16+8),menu^.x2-3);
END (* IF *);
END (* FOR *);
MouseOn();
oy := 0FFFFH;
REPEAT
GetMouseData(ptr);
x := ptr^.mouseX DIV 8;
y := ptr^.mouseY DIV 16;
IF NOT (oy=y) THEN
IF NOT (oy=0FFFFH) THEN
MouseOff();
PutText(5,menu^.leftEdge+1,oy,menu^.items[oy-2].text);
MouseOn();
oy := 0FFFFH;
END (* IF *);
IF (x>=menu^.leftEdge) AND (x<=(menu^.leftEdge+menu^.width)) THEN
IF (y>=2) AND (y<=menu^.itemCount+2) THEN
IF (menu^.items[y-2].text # NIL) AND (menu^.items[y-2].enabled=TRUE) THEN
MouseOff();
PutText(14,menu^.leftEdge+1,y,menu^.items[y-2].text);
MouseOn();
oy := y;
END (* IF *);
END (* IF *);
END (* IF *);
END (* IF *);
UNTIL (left IN ptr^.mouseButtons);
REPEAT
GetMouseData(ptr);
UNTIL NOT (left IN ptr^.mouseButtons);
IF NOT (oy=0FFFFH) THEN
bool := TRUE;
ptr^.itemNum := oy-2;
IF (menu^.items[ptr^.itemNum].checkit=TRUE) THEN
IF (menu^.items[ptr^.itemNum].checked=TRUE) THEN
menu^.items[ptr^.itemNum].checked := FALSE;
ELSE
menu^.items[ptr^.itemNum].checked := TRUE;
END (* IF *);
END (* IF *);
END (* IF *);
MouseOff();
CopyBuffer2Video(gdos^.graphics64,menu^.x1,24,w,h);
PutText(5,menu^.leftEdge,1,menu^.text);
MouseOn();
RETURN(bool);
END OpenMenu;
PROCEDURE DesktopManager(class : MessageClassSet) : SystemMessagePtr;
VAR ptr : SystemMessagePtr;
win : WindowPtr;
gad : GadgetPtr;
menu : MenuPtr;
bool : BOOLEAN;
BEGIN
bool := FALSE;
REPEAT
ptr := gdos^.systemMessage;
GetMouseData(ptr);
ptr^.window := gdos^.firstWindow;
IF (ptr=NIL) THEN
ptr^.class := MessageClassSet{noWindow};
ptr^.window := NIL;
RETURN(ptr);
END (* IF *);
IF (left IN ptr^.mouseButtons) THEN
win := GetWindowPtr(ptr^.mouseX,ptr^.mouseY);
IF (win # NIL) THEN
ptr^.window := win;
IF (win<>gdos^.firstWindow) THEN
ActivateWindow(win);
IF (win^.lock=FALSE) THEN
IF (activateWindow IN class) THEN
bool := TRUE;
ptr^.class := MessageClassSet{activateWindow};
END (* IF *);
END (* IF *);
ELSE
IF (win^.lock=FALSE) THEN
IF (ptr^.mouseY>32) THEN
gad := win^.firstGadget;
WHILE (gad # NIL) DO
IF (ptr^.mouseX>=win^.x1+gad^.x1) AND (ptr^.mouseY>=win^.y1+gad^.y1) AND (ptr^.mouseX<=win^.x1+gad^.x2) AND (ptr^.mouseY<=win^.y1+gad^.y2) THEN
IF NOT (gadBorderless IN gad^.type) THEN
MouseOff();
DrawBorder(1,15,win^.x1+gad^.x1,win^.y1+gad^.y1,gad^.w,gad^.h);
MouseOn();
REPEAT
GetMouseData(ptr);
UNTIL NOT (left IN ptr^.mouseButtons);
MouseOff();
DrawBorder(15,1,win^.x1+gad^.x1,win^.y1+gad^.y1,gad^.w,gad^.h);
MouseOn();
END (* IF *);
IF (ptr^.mouseX>=win^.x1+gad^.x1) AND (ptr^.mouseY>=win^.y1+gad^.y1) AND (ptr^.mouseX<=win^.x1+gad^.x2) AND (ptr^.mouseY<=win^.y1+gad^.y2) THEN
ptr^.gadget := gad;
IF (systemClose IN gad^.type) THEN
bool := TRUE;
ptr^.class := MessageClassSet{closeWindow};
(*
ELSE IF (systemDepth IN gad^.type) THEN
*)
ELSE
bool := TRUE;
ptr^.class := MessageClassSet{gadgetUp};
END (* IF *);
END (* IF *);
gad := NIL;
ELSE
gad := gad^.nextGadget
END (* IF *);
END (* WHILE *);
ELSE
IF (ptr^.mouseY>15) THEN
menu := win^.firstMenu;
ptr^.menuNum := 0;
ptr^.class := MessageClassSet{menuPick};
WHILE (menu # NIL) DO
IF (ptr^.mouseX>=menu^.mx1) AND (ptr^.mouseX<=menu^.mx2) THEN
IF (menu^.enabled=TRUE) THEN
REPEAT
GetMouseData(ptr);
UNTIL NOT (left IN ptr^.mouseButtons);
bool := OpenMenu(menu,ptr);
END (* IF *);
menu := NIL;
ELSE
menu := menu^.nextMenu;
ptr^.menuNum := ptr^.menuNum + 1;
END (* IF *);
END (* WHILE *);
END (* IF *);
END (* IF *);
END (* IF *);
END (* IF *);
END (* IF *);
END (* IF *);
UNTIL (bool=TRUE);
RETURN(ptr);
END DesktopManager;
BEGIN
bool := CheckVGA();
IF (bool=FALSE) THEN
Crash("Dieses Programm bentigt eine VGA-Grafikkarte!");
END (* IF *);
bool := CheckMouse();
IF (bool=FALSE) THEN
Crash("Dieses Programm bentigt eine Maus!");
END (* IF *);
bool := InstallGDOSVector();
IF (bool=FALSE) THEN
Crash("Es steht nicht genug freier Speicher zur Verfgung!");
END (* IF *);
TermProcedure(Terminator);
InstallRTErrorHandler(RTErrorHandler);
(* ------------------------------------------ *)
MouseOff();
(*
DrawBorder(15,1,50,50,500,300);
*)
DrawBorder(15,1,0,14,638,460);
DrawBorder(1,15,1,15,636,458);
DrawX(15,2,33,636);
DrawX(1,2,34,636);
(*
DrawBorder(15,1,1,14,640,18);
*)
titel[0] := "Gadget #1";
titel[1] := "Gadget #2";
titel[2] := "Gadget #3";
titel[3] := "Datei";
titel[4] := "System";
titel[5] := "Einstellungen";
titel[6] := "Information";
titel[7] := "Programm starten";
titel[8] := "Datei lschen";
titel[9] := "Datei umbenennen";
titel[10] := "Netzwerk";
titel[11] := "ber Programm-Manager";
titel[12] := "Programm beenden";
titel[15] := "Zeige versteckte Dateien";
titel[16] := "Zeige Systemdateien";
titel[25] := "Farben";
titel[26] := "Maus";
titel[27] := "Signalton";
titel[28] := "Verzeichnisse";
(*
titel[5] := "Graphical DOS User Interface - Version 0.01";
FOR a := 1 TO 15 DO
PutText(a,10,a+5,ADR(titel[5]));
END;
*)
w1 := OpenWindow(ADR(titel[0]),2,3,76,8,WindowFlagSet{memSwap,windowClose,windowDepth});
w2 := OpenWindow(ADR(titel[1]),7,7,25,11,WindowFlagSet{windowClose,windowDepth,memSwap});
m1 := AddMenu(w2,2,30,ADR(titel[3]),TRUE);
AddItem(m1,ADR(titel[6]),FALSE,FALSE,TRUE);
AddItem(m1,NIL,FALSE,FALSE,FALSE);
AddItem(m1,ADR(titel[7]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[8]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[9]),FALSE,FALSE,TRUE);
AddItem(m1,NIL,FALSE,FALSE,FALSE);
AddItem(m1,ADR(titel[10]),FALSE,FALSE,FALSE);
AddItem(m1,NIL,FALSE,FALSE,FALSE);
AddItem(m1,ADR(titel[11]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[12]),FALSE,FALSE,TRUE);
m1 := AddMenu(w2,15,30,ADR(titel[4]),TRUE);
AddItem(m1,ADR(titel[15]),TRUE,TRUE,TRUE);
AddItem(m1,ADR(titel[16]),TRUE,TRUE,TRUE);
m1 := AddMenu(w2,30,30,ADR(titel[5]),TRUE);
AddItem(m1,ADR(titel[25]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[26]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[27]),FALSE,FALSE,TRUE);
AddItem(m1,ADR(titel[28]),FALSE,FALSE,TRUE);
AddBoolGadget(w2,2,3,15,1,ADR(titel[0]),1000);
AddBoolGadget(w2,2,6,15,1,ADR(titel[1]),2000);
AddBoolGadget(w2,2,9,15,1,ADR(titel[2]),3000);
w3 := OpenWindow(ADR(titel[2]),10,10,25,10,WindowFlagSet{windowClose,windowDepth,memSwap});
(*
w4 := OpenWindow(ADR(titel[3]),13,13,25,9,WindowFlagSet{windowClose,windowDepth,memSwap});
w5 := OpenWindow(ADR(titel[4]),16,16,25,8,WindowFlagSet{windowClose,windowDepth,memSwap});
LockWindow(w5);
*)
MouseOn();
REPEAT
msg := DesktopManager(MessageClassSet{keyHit,gadgetUp,menuPick,activateWindow});
UNTIL (msg^.window=w1);
WaitForKey;
(*
Crash("Fehlermeldungs-Requester-Test");
*)
(*
IF (w1 # NIL) THEN CloseWindow(w1); END;
WaitForKey;
IF (w3 # NIL) THEN CloseWindow(w3); END;
WaitForKey;
IF (w4 # NIL) THEN CloseWindow(w4); END;
WaitForKey;
IF (w2 # NIL) THEN CloseWindow(w2); END;
WaitForKey;
IF (w5 # NIL) THEN CloseWindow(w5); END;
WaitForKey;
*)
(* ------------------------------------------ *)
UninstallRTErrorHandler;
Terminate(0);
END GDOS.